package cn.uestc.labhms.modules.hms.dao;

import cn.uestc.labhms.modules.hms.entity.HmsCommonConditionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface HmsCommonConditionDao extends BaseMapper<HmsCommonConditionEntity> {
    @Select("select distinct field_ch from hms_common_condition;")
    List<String> getCommonFiled();
    @Insert("insert into hms_common_condition (field_en, field_ch) values (#{fieldEn},#{fieldCh});")
    Integer setCommonFiled(HmsCommonConditionEntity hmsCommonConditionEntity);
    @Select("select count(*) from hms_common_condition where field_ch = #{fieldCh};")
    Integer getExistCommonFiled(String fieldCh);
    @Select("select distinct eng_field from hms_Chi_Eng where chi_field = #{fieldCh};")
    String getFieldEnByCh(String fieldCh);
    @Update("delete from hms_common_condition;")
    void clearTable();
}
